﻿using PicStore.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PicStore.Web.Lib
{
    public class Utility
    {
        public static List<SelectListItem> GetCategoryList(List<CategoryInfo> categoryInfos)
        {
            List<SelectListItem> list = new List<SelectListItem>();
            foreach (var r in categoryInfos)
            {
                SelectListItem item = new SelectListItem
                {
                    Text = r.CategoryName,
                    Value = r.Id.ToString(),
                };
                list.Add(item);
            }
            list[0].Selected = true;
            return list;
        }

        public static List<SelectListItem> GetMonthList()
        {
            List<SelectListItem> list = new List<SelectListItem>();
            for (int i = 1; i <= 12; i++)
            {
                SelectListItem item = new SelectListItem
                {
                    Text = i.ToString(),
                    Value = i.ToString(),
                };
                list.Add(item);
            }
            list[0].Selected = true;
            return list;
        }

        public static string LOGO = "Picture Management System";
    }
}